feat(agent-core-v2): add KIMI_CODE_PERMISSION_MODE_REMINDER env to disable auto-mode reminders - #3728
Conversation
…sable auto-mode reminders The auto (AFK) permission-mode enter/exit reminders are injected into the model context unconditionally. Unattended evaluation harnesses that run with auto permission mode have no way to keep that 'keep going without asking' instruction out of the prompt, which biases agentic-behavior evals. Set KIMI_CODE_PERMISSION_MODE_REMINDER=0 (also false/no/off) to skip registering the permission-mode reminder injection entirely. Default behavior is unchanged.
🦋 Changeset detectedLatest commit: e6ab90e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6ab90eb7d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ts rules Config additions to an existing feature are a patch bump, and the entry must be one short user-facing sentence without benefit clauses.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Why
Entering or leaving auto (AFK) permission mode injects a reminder into the model context ("Auto permission mode is active ... Continue normally without pausing for approval prompts ... make a reasonable decision and continue without asking the user"). The injection is registered unconditionally in
AgentPermissionModeService, so unattended evaluation harnesses that run with auto permission mode have no way to keep this "keep going without asking" instruction out of the prompt — it biases agentic-behavior evals (models become noticeably more hyperactive on multi-action tasks).What
New environment variable
KIMI_CODE_PERMISSION_MODE_REMINDER:1/true/yes/on— current behavior, unchanged (default);0/false/no/off— the permission-mode reminder injection (auto-mode enter + exit reminders) is not registered at all, so nothing mode-related is ever injected into the context.The gate lives in the
AgentPermissionModeServiceconstructor (registration site), so when disabled there is zero overhead and no behavioral difference beyond the missing reminders: mode switching, telemetry, wire records and restore all work exactly as before. Only the context injection is skipped; approval semantics of auto mode itself are untouched.Tests
permissionMode.test.ts: existing reminder tests now run with an explicit bootstrap stub; added two cases — env=0skips registration (mode ops still work), env=1keeps registration.agentLifecycle.test.ts: completed the partial bootstrap stub withgetEnv(it previously built the service with a stub missing the method).agent-core-v2suite: 6563 passed, 1 skipped. typecheck / oxlint / check-no-comments all green.